package com.zhkj.txg.module.product.adapter

import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.zhkj.lib.base.BaseApplication
import com.zhkj.txg.R

class ProductAdapter : BaseQuickAdapter<String, BaseViewHolder>(R.layout.item_product_tab) {

    init {
        addData(BaseApplication.INSTANCE.getString(R.string.tab_product))
//        addData(BaseApplication.INSTANCE.getString(R.string.tab_comment))
//        addData(BaseApplication.INSTANCE.getString(R.string.tab_detail))
    }

    var selectedPosition = 0
        set(value) {
            field = value
            notifyDataSetChanged()
        }

    override fun convert(helper: BaseViewHolder, item: String) {
        helper.setText(R.id.tvTab, item)
            .itemView.isSelected = selectedPosition == helper.layoutPosition
    }
}